CREATE TRIGGER TGCTHD_02 ON HOADON INSTEAD OF DELETE
AS
BEGIN
	DECLARE @MAHOADON VARCHAR(50)
	SET @MAHOADON =(SELECT MAHOADON FROM deleted)
	DELETE FROM ChiTietHoaDon WHERE MaHoaDon=@MAHOADON
	DELETE FROM HoaDon WHERE   MaHoaDon = @MAHOADON
	RAISERROR('XOA CHI TIET THANH CONG',16,1)
END